package demo.utils;

import java.io.Serializable;

/**
 * @author mandy.hu
 * 
 */
public class XdcsSparkConstant implements Serializable {

	private static final long serialVersionUID = 2116324119375839431L;

    public static final String TAG_TIMEOUT_THRESHOLD = "timeout_threshold";
    public static final String TAG_RESULT_CODE = "result";
	public static final String RESULT_4XX = "4xx";
	public static final String RESULT_5XX = "5xx";
    public static final String VALUE_SUCCESS = "success";
    public static final String VAULE_FAIL = "fail";

	/**
	 * TAG
	 */
	public static final String TAG_TRACKID = "trackId";
	public static final String TAG_IP = "ip";
	public static final String TAG_USERID = "userId";
	public static final String TAG_ISMOBILE = "isMobile";

	public static final String TAG_PLAY_TASK_SEQ = "playTaskSeq";
	public static final String TAG_APP = "app";
	public static final String TAG_HOST = "host";
	public static final String TAG_API = "api";

	//type类型
	public static final String TAG_IO_TYPE = "ioType";
	public static final String TAG_INSTACE_TYPE = "instanceType";
	public static final String TAG_INSTACE = "instance";


	public static final String TAG_COUNTRY_TYPE = "countryType";
	public static final String TAG_COUNTRY = "country";
	public static final String TAG_PROVINCE = "province";
	public static final String TAG_CITY = "city";
	public static final String TAG_CARRIER = "carrierOperator";
	public static final String TAG_NETWOKK = "networkMode";
	public static final String TAG_DEVICE_NAME = "deviceName";
	public static final String TAG_CDN_IP = "cdnIP";
	public static final String TAG_CDN_DOMAIN = "cdnDomain";
	public static final String TAG_ERROR_TYPE = "errorType";
	public static final String TAG_CDN_NET_TYPE = "cdnNetType";
	public static final String TAG_CDN_VALUE_TYPE = "valueType";
	public static final String TAG_CDN_DOWNLOAD_SPEED_VALUE = "download_speed";
	public static final String TAG_CDN_STATUSCODE = "statusCode";


	public static final String DB_DATASOURCE_METRIC = "db_datasource";
	public static final String TAG_DATA_SOURCE_CONNECT = "connect_key";
	public static final String TAG_DATA_SOURCE_NAME = "datasource_name";
	public static final String TAG_NUM_CONNECT = "num_connections";
	public static final String TAG_NUM_BUSY_CONNECT = "num_busy_connections";
	public static final String TAG_NUM_IDLE_CONNECT = "num_idle_connections";
	public static final String TAG_NUM_MAX_CONNECT = "num_max_connections";

	public static final String REDIS_DATASOURCE_METRIC = "redis_datasource";
	public static final String TAG_REDIS_SOURCE_CONNECT = "redis_connect_key";
	public static final String TAG_REDIS_SOURCE_NAME = "redis_source_name";
	public static final String TAG_REDIS_NUM_CONNECT = "redis_num_connections";
	public static final String TAG_REDIS_NUM_BUSY_CONNECT = "redis_num_busy_connections";
	public static final String TAG_REDIS_NUM_IDLE_CONNECT = "redis_num_idle_connections";
	public static final String TAG_REDIS_POOL_INDEX = "pool_index";//多个redis pool连同一个dbindex，序号区分

	public static final String MAINSTAY3_POOL_METRIC = "mainstay3_pool";
	public static final String MAINSTAY_POOL_METRIC = "mainstay_pool";
	public static final String MAINSTAY_CONNECT_KEY = "mainstay_pool_key";
	public static final String MAINSTAY_SOURCE_NAME = "mainstay_pool_name";

	public static final String VALUE_IDLE_CONNECT = "mainstay_idle_connections";
	public static final String VALUE_ACTIVE_CONNECT = "mainstay_active_connections";
	public static final String VALUE_MAX_CONNECT = "mainstay_max_connections";

    //M3的netty pool的关键指标
    public static final String VALUE_MAXCONNECTIONS = "mainstay3_maxConnections";
    public static final String VALUE_MAXPENDINGACQUIRES = "mainstay3_maxPendingAcquires";
    public static final String VALUE_ACQUIREDCHANNELCOUNT = "mainstay3_acquiredChannelCount";
    public static final String VALUE_PENDINGACQUIRECOUNT = "mainstay3_pendingAcquireCount";

	public static final String MAINSTAY3_SERVER_THREAD = "mainstay3_server_thread";
	public static final String MAINSTAY_SERVER_THREAD = "mainstay_server_thread";
	public static final String MAINSTAY3_THREAD_POOL_NAME = "mainstay3_thread_pool_name";
	public static final String MAINSTAY_SERVER_THREAD_NAME = "mainstay_server_thread_name";
	public static final String VALUE_WORKER_SIZE = "mainstay_worker_size";
	public static final String VALUE_QUEUE_SIZE = "mainstay_queue_size";
	
	public static final String TOMCAT_METRIC = "tomcat_metric";
	public static final String TOMCAT_METRIC_KEY = "tomcat_metric_key";
	
	public static final String TOMCAT_MAX_SESSIONS = "maxActiveSessions";
	public static final String TOMCAT_ACTIVE_SESSIONS = "activeSessions";
	public static final String TOMCAT_SESSION_COUNTER = "sessionCounter";
	
	public static final String JVM_GC_NAME = "gc_name";
	public static final String JVM_GC_COUNT = "gc_count";
	public static final String JVM_GC_TIME = "gc_time";
	
	public static final String TOMCAT_THREAD_POOL_NAME = "poolName";
	public static final String TOMCAT_MAX_THREADS = "maxThreads";
	public static final String TOMCAT_CURRENT_THREAD_COUNT = "currentThreadCount";
	public static final String TOMCAT_CURRENT_THREAD_BUSY = "currentThreadsBusy";
	public static final String TOMCAT_CURRENT_QUEUE_SIZE = "queueSize";
	public static final String TOMCAT_CURRENT_POOL_SIZE = "poolSize";
	public static final String TOMCAT_CURRENT_ACTIVE_COUNT = "activeCount";

	public static final String TAG_CALLER_APP = "app";
	public static final String TAG_CALLER_HOST = "host";
	public static final String TAG_CALLER_API = "api";
	
	public static final String TAG_CALLEE_APP = "c-app";
	public static final String TAG_CALLEE_HOST = "c-host";
	public static final String TAG_CALLEE_API = "c-api";
	
	public static final String TAG_DB_IP_PORT = "dbUrl";
	public static final String TAG_DB_NAME = "dbName";
	
	public static final String TAG_REDIS_IP_PORT = "redisIp";
	public static final String TAG_REDIS_OPER = "redisOper";
	
	
	public static final String TAG_METHOD_CLASS = "methodClass";
	public static final String TAG_METHOD_METHOD = "methodMethod";

	public static final String TAG_VERSION = "version";
	public static final String TAG_PACKAGENAME = "packageName";
	public static final String TAG_MODULE = "module";
	
	public static final String TAG_CHANNEL = "channel";

	public static final String TAG_PERCENT = "percent";
	public static final String VALUE_AVG = "avg";
	public static final String VALUE_99PERCENT = "99";
	public static final String VALUE_85PERCENT = "85";
	public static final String VALUE_95PERCENT = "95";
	public static final String VALUE_MIN = "min";
	public static final String VALUE_MAX = "max";

	public static final String VALUE_75PERCENT = "75";
	public static final String VALUE_999PERCENT = "99.9";
	public static final String VALUE_9999PERCENT = "99.99";


	public static final String VALUE_10PERCENT = "10";
	public static final String VALUE_20PERCENT = "20";
	public static final String VALUE_30PERCENT = "30";
	public static final String VALUE_40PERCENT = "40";
	public static final String VALUE_50PERCENT = "50";
	public static final String VALUE_60PERCENT = "60";
	public static final String VALUE_70PERCENT = "70";
	public static final String VALUE_80PERCENT = "80";
	public static final String VALUE_90PERCENT = "90";

	//错误日志分类
	public static final String LOG_CLASSIFY_TYPE = "log_classify_type";
	public static final String TYPE_RABBITMQ = "rabbitmq";
	public static final String TYPE_DB = "db";
	public static final String TYPE_REDIS = "redis";
	public static final String TYPE_ZK = "zk";
	public static final String TYPE_OOM = "oom";
	public static final String TYPE_MAINSTAY = "mainstay";
	public static final String TYPE_KAFKA = "kafka";
	public static final String TYPE_OTHER = "other";

	public static final String TAG_LOG_TYPE = "log_type";
	public static final String TAG_LEVELE = "level";
	public static final String TAG_HYTRIX_GROUP_KEY = "g_key";
	public static final String TAG_HYTRIX_COMMAND_KEY = "c_key";
	public static final String LOG_ERROR_LEVEL_VALUE = "ERROR";
	public static final String LOG_WARN_LEVEL_VALUE = "WARN";
	public static final String LOG_FATAL_LEVEL_VALUE = "FATAL";
	public static final String LOG_INFO_LEVEL_VALUE = "INFO";
	public static final String LOG_DEBUG_LEVEL_VALUE = "DEBUG";

	public static final String TAG_STAT_SOURCE = "stat-source";

    public static final String FLUME_TYPE = "flume_type";
    public static final String FLUME_TYPE_HBASE = "HBASE";
    public static final String FLUME_TYPE_HDFS = "HDFS";
    public static final String FLUME_TYPE_OTHER = "OTHER";
    public static final String CHANNEL_NAME = "channel_name";
    public static final String FLUME_DATA_TYPE = "data_type";

    //redis process metric
    public static final String REDIS_PROCESS_IP = "redisIp";
    public static final String REDIS_PROCESS_DATA_TYPE = "data_type";
    public static final String REDIS_PROCESS_DB_INDEX_NAME = "db_name";
    public static final String REDIS_PROCESS_DB_KEY_TYPE = "db_type";
    public static final String REDIS_PROCESS_IS_RUNNING = "is_running";
    public static final String REDIS_PROCESS_IS_RUNNING_FAIL_VALUE = "not_running";

    //monitor Type
    public static final String SPARK_MONITOR_TYPE = "s_monitor_type";
    public static final String SPARK_MONITOR_TYPE_DB = "db";
    public static final String SPARK_MONITOR_TYPE_REDIS = "redis";
    public static final String SPARK_MONITOR_TYPE_METHOD = "method";
    public static final String SPARK_MONITOR_TYPE_RPC = "rpc";
    public static final String SPARK_MONITOR_TYPE_HTTP = "http";

    //httpdns constants
    public static final String HTTPDNS_DOMAIN_KEY = "httpdns_domain";
//    public static final String HTTPDNS_IPS_KEY = "httpdns_ips";
//    public static final String HTTPDNS_GRADES_KEY = "httpdns_grades";
    public static final String HTTPDNS_SCORE_TIME_KEY = "httpdns_score_time";

	public static final String HTTPDNS_IP_KEY = "httpdns_ip";
	public static final String HTTPDNS_PORT_KEY = "httpdns_port";
	public static final String HTTPDNS_GRADE_KEY = "httpdns_grade";
	public static final String HTTPDNS_RTT_KEY = "httpdns_rtt";
	public static final String HTTPDNS_SP_KEY = "httpdns_sp";
	public static final String HTTPDNS_SUCCESS_NUM_KEY = "httpdns_success_num";
	public static final String HTTPDNS_ERR_NUM_KEY = "httpdns_err_num";
	public static final String HTTPDNS_FINALLY_SUCCESS_TIME_KEY = "httpdns_finally_success_time";
	public static final String HTTPDSN_FINALLY_FAIL_TIME_KEY = "httpdns_finally_fail_time";

	public static final String TAG_COMPID = "compid";
	public static final String TAG_COMPV = "compv";
	public static final String TAG_JSV = "jsv";

	public static final String TAG_PAGEID = "pageid";
	public static final String TAG_DEVICENAME = "deviceName";
	public static final String TAG_NETWORKMODE = "networkMode";

	//app启动时间的tsdb tag
	public static final String TAG_APPSTARTTIME_DEVICENAME = "deviceName";
	public static final String TAG_APPSTARTTIME_DEVICETYPE = "deviceType";
	public static final String TAG_APPSTARTTIME_CHANNEL = "channel";
	public static final String TAG_APPSTARTTIME_VERSION = "version";
	public static final String TAG_APPSTARTTIME_OSVERSION = "osversion";
	public static final String TAG_APPSTARTTIME_MANUFACTURER = "manufacturer";
	public static final String TAG_APPSTARTTIME_CARRIEROPERATOR = "carrierOperator";
	public static final String TAG_APPSTARTTIME_NETWORKMODE = "networkMode";
	public static final String TAG_APPSTARTTIME_FIRSTSTART = "firstStart";
	public static final String TAG_APPSTARTTIME_PERCENT = "percent";


	/**
	 * timeRange_mainstay tags and value
	 */
	public static final String TIME_RANGE_KEY = "timeRangeKey";
	public static final String TIME_RANGE_KEY_50 = "50";
	public static final String TIME_RANGE_KEY_100 = "100";
	public static final String TIME_RANGE_KEY_200 = "200";
	public static final String TIME_RANGE_KEY_500 = "500";
	public static final String TIME_RANGE_KEY_1000 = "1000";




}
